<?php

/**
 * CommandeClient form base class.
 *
 * @method CommandeClient getObject() Returns the current form's model object
 *
 * @package    ProjetBar
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseCommandeClientForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id_commande_client'   => new sfWidgetFormInputHidden(),
      'id_serveur'           => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Serveur'), 'add_empty' => false)),
      'id_table_client'      => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('TableClient'), 'add_empty' => false)),
      'id_etat_commande'     => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('EtatCommande'), 'add_empty' => false)),
      'date_commande_client' => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id_commande_client'   => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id_commande_client')), 'empty_value' => $this->getObject()->get('id_commande_client'), 'required' => false)),
      'id_serveur'           => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Serveur'))),
      'id_table_client'      => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('TableClient'))),
      'id_etat_commande'     => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('EtatCommande'))),
      'date_commande_client' => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('commande_client[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'CommandeClient';
  }

}
